from django import forms

class UserForm(forms.Form):
        
    first_name = forms.CharField(max_length=100) 
    email = forms.EmailField(max_length=100)
    password = forms.CharField(widget=forms.PasswordInput())
    confirm_password = forms.CharField(widget=forms.PasswordInput())
    
    def clean(self):
        cleaned_data = self.cleaned_data
        passw = cleaned_data.get('password')
        confirm_passw = cleaned_data.get('confirm_password')
        if passw != confirm_passw:
            raise forms.ValidationError("As senhas digitadas devem ser iguais.")
        return cleaned_data